package com.lry.basic.disruptor;


public class Main {
    public static void main(String[] args) {

        HmilyDisruptor<HmilyTransactionTask> disruptor = new HmilyDisruptor<>(new HmilyTransactionEventConsumer(),
                Runtime.getRuntime().availableProcessors() << 1, HmilyDisruptor.DEFAULT_SIZE);

        disruptor.startup();

        disruptor.getProvider().onData(() -> {
            System.out.println(1);
        });


        HmilyDisruptor<Integer> disruptor2 = new HmilyDisruptor<>(new IntegerConsumer(),
                Runtime.getRuntime().availableProcessors() << 1, HmilyDisruptor.DEFAULT_SIZE);
        disruptor2.startup();
        disruptor2.getProvider().onData(2);

    }
}
